package com.example.layuitest.mapper;

import com.example.layuitest.entity.Article;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository

public interface ArticleMapper {
    @Select("select count(*) from t_article")
    public Integer getArticle();
    @Select("select * from t_article limit #{start},#{limit}")
    public List<Article> getArticlePage(Map<String,Integer> param);
    @Delete("delete * from t_article where id=#{id}")
    public Integer deleteArticleIds(Integer ids);
    @Select("select * from t_article where id=#{id}")
    public Article getArticleByid(Integer id);
    @Update("update t_article set title=#{title},categories=#{categories},created=#{created},city=#{city} where id=#{id}")
    public Integer updateArticle(Article article);
}
